<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="MetaEditDlg" widgetVar="MetaEditDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.EditMetaTitle}">
            <h:form id="MetaEditForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{metaController.selected != null}">
                        <p:outputLabel value="#{bundle.EditMetaLabel_idMeta}" for="idMeta" />
                        <p:inputText id="idMeta" value="#{metaController.selected.idMeta}" title="#{bundle.EditMetaTitle_idMeta}" required="true" requiredMessage="#{bundle.EditMetaRequiredMessage_idMeta}"/>
                        <p:outputLabel value="#{bundle.EditMetaLabel_descripcion}" for="descripcion" />
                        <p:inputText id="descripcion" value="#{metaController.selected.descripcion}" title="#{bundle.EditMetaTitle_descripcion}" />
                        <p:outputLabel value="#{bundle.EditMetaLabel_idObjetivoEstrategico}" for="idObjetivoEstrategico" />
                        <p:selectOneMenu id="idObjetivoEstrategico" value="#{metaController.selected.idObjetivoEstrategico}" required="true" requiredMessage="#{bundle.EditMetaRequiredMessage_idObjetivoEstrategico}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{objetivoEstrategicoController.itemsAvailableSelectOne}"
                                           var="idObjetivoEstrategicoItem"
                                           itemValue="#{idObjetivoEstrategicoItem}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{metaController.update}" value="#{bundle.Save}" update="display,:MetaListForm:datalist,:growl" oncomplete="handleSubmit(args, 'MetaEditDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="MetaEditDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
